<?php
include dirname(__FILE__).'/s_user-verify.php';
include dirname(__FILE__).'/function.php';
?>
<html>
	<head>
		<title>用户中心</title>
	<?php include dirname(dirname(dirname(__FILE__))).'/include/common-header.php';?>
	</head>
	<body>
	<div class="main-div ">
		<ul class="nav nav-tabs" role="tablist">
		  <li class="active"><a href="#home" role="tab" data-toggle="tab">个人资料修改</a></li>
		  <li><a href="#place-apply" role="tab" data-toggle="tab">场地申请</a></li>
		  
		</ul>
		<!-- Tab panes -->
		<div class="tab-content">
		
 			<div class=" tab-pane fade in active" id="home">
 			
 				<div class="container-fluid">
			<div class="row">
				
				<div class="col-sm-8">
					<a href="s_user-edit.php" class="btn btn-primary" role="button" >编辑</a>
					<a href="password-edit.php" class="btn btn-primary" role="button" >修改密码</a>
				</div>
				<div class="col-sm-2">
				</div>
			</div>
		</div>
 			</div>
 			
 			<div class="tab-pane fade " id="place-apply">
 				<div class="container">
 						<table class="table table-striped table-bordered table-hover table-condensed default-table">
			  <tr>
			  	<th>个人申请列表</th>
			  	<th>场地时间</th>
			  	<th>时间 段</th>
			  	<th>申请时间</th>
			  	<th>状态</th>
			  </tr>
			  <?php
			  		$ret=getPlaceApplyByUserId($_SESSION["s_user_id"]);
			  		if ($ret) {
						$i=1;
							while ($row=mysql_fetch_array($ret)){
								$start=8+$row["period"]*2;
								$end=10+$row["period"]*2;
								echo "<tr>";
								echo "<th>".$i."</th>";
								echo "<th>".$row['date']."</th>";
								echo "<th>".$start."~".$end."点"."</th>";
								echo "<th>".$row['create_time']."</th>";
								if($row['status']==0){
									
									echo "<th>"."审核中"."</th>";
									
								}
								if($row['status']==1){
										
									echo "<th>"."通过申请"."</th>";
										
								}
								if($row['status']==2){
								
									echo "<th>"."申请失败"."</th>";
								
								}
							
								echo "</tr>";
								$i++;
							}
			  		} 
			  ?>
			  
			</table>
 				</div>
 			</div>
 		</div>
 </div>
		
	</body>
</html>
